package demo;

import cn.hutool.core.bean.BeanUtil;
import com.simple.annotation.Config;
import com.simple.core.Center;
import com.simple.core.InstanceConfig;
import com.simple.manager.impl.InstanceManager;

@Config
public class CenterConfig implements InstanceConfig {

    @Override
    public void config(InstanceManager instanceManager) {
        UdpCenter udpCenter = new UdpCenter();
        String name = Center.class.getName();
        Center center = (Center) instanceManager.get(name);
        BeanUtil.copyProperties(center, udpCenter);
        instanceManager.register(name, udpCenter);
    }
}
